package com.sunxboy.platform.option;

import org.apache.log4j.Level;

public class CommandLineOptions {

    private Level logLevel;
    private String sharedHome;
    private String environment;
    private String applicationId;
    private String instanceId;
    private String logConfigLocation;
    private final static String DEFAULT_LOGGING = "log4j.xmlt";

    public Level getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(String logValue) {
        this.logLevel = Level.toLevel(logValue);
    }

    public String getSharedHome() {
        return sharedHome;
    }

    public void setSharedHome(String sharedHome) {
        this.sharedHome = sharedHome;
    }

    public String getEnvironment() {
        return environment;
    }

    public void setEnvironment(String environment) {
        this.environment = environment;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public String getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    public String getLogConfigLocation() {
        if (logConfigLocation == null) {
            logConfigLocation = System.getProperties().getProperty("resource.context") + DEFAULT_LOGGING;
        }
        return logConfigLocation;
    }

    public void setLogConfigLocation(String logConfigLocation) {
        this.logConfigLocation = logConfigLocation;
    }
}
